package com.dhcc.DRGsHosp.facade.impl.assembler;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

import com.dhcc.DRGsHosp.core.domain.ADRG;
import com.dhcc.DRGsHosp.facade.dto.ADRGDTO;

public class ADRGAssembler {
	
	public static ADRGDTO  toDTO(ADRG  aDRG){
		if (aDRG == null) {
			return null;
		}
    	ADRGDTO result  = new ADRGDTO();
	    	result.setAdrgCode (aDRG.getAdrgCode());
     	    	result.setAdrgDesc (aDRG.getAdrgDesc());
     	    	result.setMdcCode (aDRG.getMdcCode());
     	    	result.setVerCode (aDRG.getVerCode());
     	    return result;
	 }
	
	public static List<ADRGDTO>  toDTOs(Collection<ADRG>  aDRGs){
		if (aDRGs == null) {
			return null;
		}
		List<ADRGDTO> results = new ArrayList<ADRGDTO>();
		for (ADRG each : aDRGs) {
			results.add(toDTO(each));
		}
		return results;
	}
	
	 public static ADRG  toEntity(ADRGDTO  aDRGDTO){
	 	if (aDRGDTO == null) {
			return null;
		}
	 	ADRG result  = new ADRG();
        result.setAdrgCode (aDRGDTO.getAdrgCode());
         result.setAdrgDesc (aDRGDTO.getAdrgDesc());
         result.setMdcCode (aDRGDTO.getMdcCode());
         result.setVerCode (aDRGDTO.getVerCode());
 	  	return result;
	 }
	
	public static List<ADRG> toEntities(Collection<ADRGDTO> aDRGDTOs) {
		if (aDRGDTOs == null) {
			return null;
		}
		
		List<ADRG> results = new ArrayList<ADRG>();
		for (ADRGDTO each : aDRGDTOs) {
			results.add(toEntity(each));
		}
		return results;
	}
}
